package cn.foolishbird.crow.core;

import java.util.Objects;

/**
 * @author foolish bird
 * @email luohongtu@foolishbird.cn
 */
public class DefaultDBObject implements DBObject<Long> {

    /**
     * 主键
     */
    protected Long id;

    /**
     * 创建时间
     */
    protected Long createTime;

    /**
     * 创建者
     */
    protected Long createBy;

    /**
     * 修改时间
     */
    protected Long updateTime;

    /**
     * 修改者
     */
    protected Long updateBy;

    /**
     * 逻辑删除字段
     */
    protected Boolean delFlag;


    @Override
    public Long id() {
        return this.id;
    }

    @Override
    public Long createTime() {
        return this.createTime;
    }

    @Override
    public String createBy() {
        return Objects.isNull(this.createBy) ? null : String.valueOf(this.createBy);
    }

    @Override
    public Long updateTime() {
        return this.updateTime;
    }

    @Override
    public String updateBy() {
        return Objects.isNull(this.updateBy) ? null : String.valueOf(this.updateBy);
    }

    @Override
    public Boolean deleteFlag() {
        return this.delFlag;
    }
}
